In the present study, an exact solution for free vibration analysis of piezoelectric nanobeams based on the nonlocal theory is obtained. The Euler beam model for a long and thin beam structure is employed, together with the electric potential satisfying the surface free charge condition for free vibration analysis. The governing equations and the boundary conditions are derived using Hamilton's principle. These equations are solved analytically for the vibration frequencies of beams with various end conditions. The model has been verified with the previously published works and found a good agreement with them. A detailed parametric study is conducted to discuss the influences of the nonlocal parameter, on the vibration characteristics of piezoelectric nanobeams. The exact vibration solutions should serve as benchmark results for verifying numerically obtained solutions based on other beam models and solution techniques.